package pyx.crazycards.game.managers;

import pyx.crazycards.game.managers.annotation.DataObject;
import pyx.crazycards.game.managers.annotation.Propertie;
import pyx.crazycards.game.managers.persistence.Persistable;

@DataObject(name = "user", base = "crazy.cards.game")
public class User extends Persistable {
//TODO ta faltando detalhes pertinentes ao usuario, cartao grana essa coisas
	@Propertie(name = "name")
	String name;

	@Propertie(name = "fullName")
	String fullName;
	
	@Propertie(name = "password")
	String password;

//	@Propertie(name = "cards", dataObjectCollection=true)
//	List<Card> cards;
	
	@Propertie(name = "points")
	Long points;
	
	public User() {
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

//	public List<Card> getCards() {
//		return cards;
//	}
//
//	public void setCards(List<Card> cards) {
//		this.cards = cards;
//	}

	@Override
	public String toString() {
		return super.toString() + ", name=" + name + ", password=" + password;
	}

	public Long getPoints() {
		return points;
	}

	public void setPoints(Long points) {
		this.points = points;
	}
	

	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		User other = (User) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}
	
	
}
